<!DOCTYPE html>
<html lang="zh_CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>rem单位</title>
  <style>
    html {
      color:red;
      font-size: 2rem;
    }
    div[class$='3']{font-size: 5rem;}
    div[class$='4'] {font-size: 160px;}

    div[class^='1'] {
      font-size: 2em;
      width: 10em;
      height: 10em;
      border: 1px solid;
    }
    div[class$='2'] {width: 5em; height: 5em;border: 1px solid black;}
  </style>
</head>
<body>
  <div class="div1">恭喜发财</div>
  <div class="div2">恭喜发财</div>
  <div class="div3">恭喜发财</div>
  <div class="div4">恭喜发财</div>

  <div class="1em">
    <div class="em2"></div>
    <div class="em3"></div>
  </div>
  
</body>
</html>